package com.itheima.edu.info.manager.day10;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class YanYuanTest {
    public static void main(String[] args) {
        ArrayList<String>list=new ArrayList<>();
        list.add("马牛逼");
        list.add("马云");
        list.add("马花藤");
        list.add("马飞飞");
        list.add("大师马");
        list.add("JKL");
        ArrayList<String>list1=new ArrayList<>();
        list1.add("秀儿");
        list1.add("鸡熊");
        list1.add("鸡哥");
        list1.add("老毕等");
        list1.add("乌鸡哥");
        list.stream().filter(s->s.length()==3).limit(4);
        list1.stream().filter(s->s.startsWith("鸡",1));
       // Stream.concat(list.stream(),list1.stream()).forEach(s -> System.out.println(s));
        List<String> list2 = Stream.concat(list.stream()
                .filter(s -> s.length() == 3).limit(4), list1.stream()
                .filter(s -> s.startsWith("鸡", 1)))
                .collect(Collectors.toList());
        System.out.println(list2);
        for (String s : list2) {
            YanYuan yanYuan=new YanYuan(s);
            System.out.println(yanYuan);
            if(list2.get(list2.size()-1)==s){
                System.out.println("--------11111111111111");
                System.out.println(yanYuan);
            }

        }
        System.out.println("-----------");
        for (int i = 0; i < list2.size(); i++) {
            YanYuan yy=new YanYuan(list2.get(i));
            System.out.println(yy);
        }
      //

    }
}
